@echo off
echo Initializing and starting the project...

:: 切换到批处理文件所在的目录
cd /d %~dp0

:: 检查是否安装了 Node.js
where node >nul 2>nul
if %errorlevel% neq 0 (
    echo Node.js is not installed or not in the PATH. Please install Node.js and try again.
    pause
    exit /b 1
)

:: 运行 npm install
echo Installing dependencies...
call npm install
if %errorlevel% neq 0 (
    echo Failed to install dependencies. Please check your network connection and try again.
    pause
    exit /b 1
)